let str = 'border-bottom-color';
function transformStr(str) {
  var reg = /-(\w)/g;
  return str.replace(reg, function($1, $2, $3) {
    console.log($1, $2, $3);
    return $1.toUpperCase();
  })
}

console.log(transformStr(str));